<?php 
//Security Checking for the user if allowed to login.
session_start();
if(strlen($_SESSION['u_name'])==0)
{
	?>
	<script>
	window.open("admin-login.php","_self");
	</script>
	<?php 
	exit;
}
?>
<html>
<style type="text/css">
.body {
	background-color:#a6bf79;
	color:#000000;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	margin: 10px 10px 10px 10px;
	padding: 0px;
}
.textLike
{
	color:#000000;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	padding: 0px;
}
</style>
<title>Admin -HomePage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="../js/jquery-1.4.2.js" type="text/javascript" language="javascript"></script>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/menu.css" rel="stylesheet" type="text/css" />
</head>
<body class="body">
<div id="body" style="width:960px;">
<div align="center">
<!-- Admin Home Page Menu Bar -->

<ul id="list-nav">
<li><a href="admin-homepage.php">Home</a></li>
<li><a href="admin-homepage.php">All Listings</a></li>
<!--<li><a href="approved-listing.php">Approved Listing</a></li>-->
<li><a href="unapproved-listing.php">Deactivated Listing</a></li>
<li><a href="new-listing.php">New Lists</a></li>
<li><a href="admin-themelist.php">Theme List</a></li>
<li><a href="secure.php?logout=yes">Log Out</a></li>
</ul>


<!-- Menu Bar Ends -->
</div>
<br />

		<script type="text/javascript">
		
		function ChangePass()
		{
			
				var newPass = $('#txtPassswordnew').val();
				var confirmPass = $('#txtPassswordconf').val();
				var clientUid = "<?php echo $client_user_id; ?>";
				if(newPass.length!=0 && confirmPass.length!=0)
				{
					if(newPass!=confirmPass)
					{
						$.post('changeP.php',{newPass:newPass,clientUid:clientUid},function(data){
						if(data==1)
						{
							alert("Password saved");
							window.location.reload();
						}
						else
						{
							alert("Sorry, Please try again.");
							return false;
						}
							},"text");
					}
					else
					{
						alert("Password do not match");
						return false;
					}
				}
				else
				{
					alert("There is a problem.");
				}
		
		}
		</script>
</head>
<body class="body">
<div style="width:960px;">

<table width="75%" cellpadding="0" cellspacing="0" align="center">



<tr>
<td height="20px" align="right" style="padding-right: 0px;">
<a href="changepassword.php">Change Password</a>
</td>
</tr>

<tr>
<td>
	<style media="all" type="text/css">@import "../css/menu.css";</style>
	
</td>
</tr>


<tr>
<td>

</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td width="500">
<fieldset>
<legend>Set New Password</legend>
<table cellpadding='0' cellspacing='0' border="0" align="center" style="padding:10px 0 0 10px;">
	<tr>
		<td>
		New Password: 
		</td>
		<td>
		&nbsp;
		</td>
		<td>
		<input type='password' value='' name='txtPassswordnew' id='txtPassswordnew' />
		</td>
	</tr>
	<tr>
		<td colspan='3'>&nbsp;
		</td>
	</tr>
	<tr>
		<td>
		Confirm Password:
		</td>
		<td>
		&nbsp;
		</td>
		<td>
		<input type='password' value='' name='txtPassswordconf' id='txtPassswordconf' />
		</td>
	</tr>
	<tr>
		<td colspan='3'>&nbsp;
		</td>
	</tr>
	<tr>
		<td colspan="3" align="center">
			<input type="button" id="btnChangePass" name="btnChangePass" value="Change Password" onclick="ChangePass()" />
		</td>
	</tr>
	</table>
	</fieldset>
</td>
</tr>
</table>
</div>
</body>
</html>